<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/base.jsp"%>
<!-- 添加慢性病证信息-->
<%
	//获取农合证号参数
	String persCode = request.getParameter("id");
	Register model = new Register(persCode);
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/admin.css">
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/admin.js"></script>
<!-- 引入第三方日期JS组件 -->
<script type="text/javascript" src="third/laydate/laydate.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		//重新绑定表单提交
		$("#add_btn").bind("click", function() {
			$('form').submit();
		});
	});
	//选择不同的村组
	function chooseGroup(){
		var val=$("#illName").val();
		$.ajax({
			   type: "POST",
			   url: "<%=path%>/system/ChronicdisServlet?m=groupList",
			data : {
				"illCode" : val
			},
			dataType : "json",
			success : function(data) {
				$("#illName").empty();
				$.each(data, function(i, val) {
					$("#illName").append(
							"<option value='"+val.illCode+"'>" + val.illName
									+ "</option>");
				});
			}
		});
	}
	function cascade() {
		var illName = $("#illName").find("option:selected").attr("data");
		var illName = $("#illName").find("option:selected").text();
	}
</script>

</head>

<body>

	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>增加慢性病证</strong>
		</div>
		<div class="body-content">
			<form id="form-add" method="post"
				action="<%=path%>/system/ChronicCardServlet?m=add">
				<div class="form-x">
					<div class="form-group">
						<div class="label">
							<label>慢性病证号:</label>
						</div>
						<div class="field">
							<input type="text" id="id" name="id"
								ata-validate="required:慢性病证号不能为空" class="input w50" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>农合证号:</label>
						</div>
						<div class="field">
							<input type="text" name="persCode"
								value="<%=model.getPersCode()%>" readonly="readonly"
								class="input w50" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>姓名：</label>
						</div>
						<div class="field">
							<input type="text" name="persName"
								value="<%=model.getPersName()%>" class="input w50" />
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>身份证号：</label>
						</div>
						<div class="field">
							<input type="text" name="cardId" readonly="readonly"
								value="<%=model.getCardId()%>" class="input w50" />
							<div class="tips"></div>
						</div>
					</div>


					<div class="form-group">
						<div class="label">
							<label>疾病名称：</label>
						</div>
						<div class="field">
							<input type="text" id="illName" name="illName" value=""
								data-validate="required:疾病名称不能为空" class="input w50">
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>起始时间：</label>
						</div>
						<div class="field">
							<input type="date" id="startTime" name="startTime"
								data-validate="required:起始时间不能为空" class="input w50">
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>终止时间：</label>
						</div>
						<div class="field">
							<input type="date" id="endTime" name="endTime"
								data-validate="required:终止时间不能为空" class="input w50">
							<div class="tips"></div>
						</div>
					</div>

					<div class="form-group">
						<div class="label">
							<label></label>
						</div>
						<div class="field">
							<button id="add_btn" class="button bg-main icon-check-square-o"
								type="button">提交</button>
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
	<!--渲染JS日期组件 -->
	<script type="text/javascript">
		laydate.render({
			elem : '#birthday'
		});
	</script>
</body>
</html>
